1. Field of the Invention
The present invention relates generally to an improved data processing system, and in particular, to a computer implemented method for selective memory compression. More particularly, the present invention relates to a computer implemented method, system, and computer usable program code for selective memory compression for multi-threaded applications in a data processing environment.
2. Description of the Related Art
The performance of a data processing system may be limited by the system's memory, which may prevent the system from taking advantage of system resources. Memory compression techniques are used to increment a data processing system's available memory and thereby allow the system to improve the use of system resources.
Generally, a compressed memory system is based on the reservation of some physical memory to store compressed data, virtually increasing the amount of memory available to the system's computer program applications. The number of retrieval requests sent to a relatively slow hardware device may be reduced if information retrieved from a previous request to the device is stored in the extra memory, thereby saving time that would have been required for the additional retrieval requests. Furthermore, this extra memory may allow the execution of applications with larger memory requirements.
A memory compression system may rely on maintaining two pools of memory, an uncompressed pool of memory and a compressed pool of memory. According to one currently used method, a data processing system's operating system may select a memory region that has been least recently used, compress this selected memory region's data, and move this compressed data to the compressed pool of memory. When a memory region that has had the region's data compressed is subsequently accessed, the operating system may decompress the compressed memory region's data that is stored in the compressed pool of memory, and move the decompressed data back to the uncompressed pool of memory. Time delays for a memory compression system may not be noticeable because the latency to decompress any compressed data is relatively small, and limited mostly by the speed of the data processing system's central processing unit(s).
However, a memory compression system may face challenges in selecting the best memory region for compression. A memory region is typically selected for compression based on the most recent access to the memory region. Sometimes such selections for compression result in no noticeable adverse consequences for the data processing system, but sometimes such selections for compression result in adverse consequences for the data processing system. When memory regions are poorly selected for compression, an application using the memory region selected for compression may experience delays, performance deterioration, and even error conditions. Overall data processing system's performance may suffer from high central processing unit overheads and adverse impacts on system response times.